package com.ljr.common;

import com.ljr.request.ApiRequest;

/**
 * @author ljr
 * @version 1.0
 * @description: TODO
 * @date 2021/12/21 8:02
 */
public class ApiAuthenticator {

    private String url;

    private CredentialStorage credentialStorage;

    public ApiAuthenticator() {
        this.credentialStorage = new RedisCredentialStorage();
    }

    public ApiAuthenticator(String url, CredentialStorage credentialStorage) {
        this.credentialStorage = credentialStorage;
    }

    public boolean auth(String url){
        ApiRequest apiRequest = ApiRequest.parseUrl(url);
        return auth(apiRequest);
    }

    public boolean auth(ApiRequest apiRequest){
        long timeStamp = apiRequest.getTimestamp();
        String token = apiRequest.getToken();


        return true;

    }

}
